﻿function ToSearch(name) {
    var key = escape(document.getElementById('search1').value);
    var date1 = document.getElementById('date1').value;
    var date2 = document.getElementById('date2').value;
    if (date1 > date2) {
        alert("开始时间不能大于结束时间！");
    }
    else {
        if (key.length < 6) {
            alert("请输入完整股票代码。");
        }
        else {
            window.location.href = 'http://localhost:8371/eGoldSearch.aspx?col=' + name + '&key=' + key + '&date1=' + document.getElementById('date1').value + '&date2=' + document.getElementById('date2').value;
        }
    }   
}

function ToSearchText(name) {
    var key = escape(document.getElementById('search').value);
    window.location.href = 'http://localhost:8371/eGoldSearch.aspx?col=' + name + '&key=' + key + '&date1=' + document.getElementById('date1').value + '&date2=' + document.getElementById('date2').value;
}

var d = new Date();
var month = d.getMonth() + 1;
var day = d.getDate();
if (month < 10) { month = "0" + String(month); }
if (day < 10) { day = "0" + String(day); }
 var strdate = String(d.getFullYear()) +  month + day ;
 var imgpath = "http://192.168.6.2/CMS/gold/dataimg/" + strdate + "/";



 function IsNum(e) {
     var k = window.event ? e.keyCode : e.which;
     if (((k >= 48) && (k <= 57)) || k == 8 || k == 0) {
     } else {
         if (window.event) {
             window.event.returnValue = false;
         }
         else {
             e.preventDefault(); //for firefox 
         }
     }

 } 
